<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="GestioneComponente.Componente"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<jsp:useBean id="assemblaggio" scope="session" class="GestioneAssemblaggio.Assemblaggio" />
</head>
<body>
<%
	if(request.getParameter("id")!=null){
		String s=request.getParameter("id");
		int c=0;
		for(Componente i:assemblaggio.getPezziScelti()){
			if(i.getIdProdotto().equals(s)){
				c=assemblaggio.getPezziScelti().lastIndexOf(i);
			}			
		}
		assemblaggio.getPezziScelti().remove(c);
	}
	else{
		if(request.getParameter("count")!=null){
			int i=assemblaggio.getPezziScelti().size();
			%>
			<input id="num_elemento" type="hidden" value="<%=i%>" />
			<%
		}
	}
%>
</body>
</html>